<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <html>
 <head>
 <title>vxBug</title>
 <link rel="shortcut icon" type="image/x-icon" href="<c:out value="${pageContext.request.contextPath}" />/resources/favicon.ico" />
     <!-- Latest compiled and minified CSS -->
     <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
     <link rel="stylesheet" href="quarcum.dyndns.org:8087/resources/css/main.css">
 </head>
<body>
<div class="container">

 <%@ include file="header_login.jsp" %>
     <div class="jumbotron">
     <ol class="breadcrumb">
         <li><a href="http://quarcum.dyndns.org:8087/">Hub</a></li>
         <li><a href="http://quarcum.dyndns.org:8087/vxBug/">vxBug</a></li>
         <li class="active">Buglist for ${p.name}</li>
         <!--
         <li><a href="#">Library</a></li>
         <li class="active">Data</li> -->
     </ol>
     </div>
    <div class="panel panel-default">
        <div class="panel-body">
            <button type="button" class="btn btn-default" navbar-btn onclick="location.href='/vxBug/program/${p.id}/addBug'"><span class="glyphicon glyphicon-plus-sign"></span> Submit new bug</button>
            <br />
        </div>
    </div>


         <div class="list-group">
             <c:forEach items="${bugs}" var="b">
                 <a href="/vxBug/program/${p.id}/bug/${b.id}" class="list-group-item">
                     <h4 class="list-group-item-heading">Bug#${b.id} - ${b.bugTitle}
                         <c:choose>
                             <c:when test="${b.status == 'Open'}">
                                 <span class="label label-info">${b.status}</span>
                             </c:when>
                             <c:otherwise>
                                 <span class="label label-default">${b.status}</span>
                             </c:otherwise>
                         </c:choose>

                     </h4>
                     <p class="list-group-item-text">By ${b.openerUserName} on ${b.date} found in ${p.name} v.${b.programVersionWithBug}.
                         <c:choose>
                         <c:when test="${b.priority == 'Critical'}">
                     <td>Priority: <span class="label label-danger">${b.priority}</span></td>
                     </c:when>
                     <c:when test="${b.priority == 'High'}">
                         <td>Priority: <span class="label label-warning">${b.priority}</span></td>
                     </c:when>
                     <c:when test="${b.priority == 'Normal'}">
                         <td>Priority: <span class="label label-primary">${b.priority}</span></td>
                     </c:when>
                     <c:when test="${b.priority == 'Low'}">
                         <td>Priority: <span class="label label-success">${b.priority}</span></td>
                     </c:when>
                     </c:choose>
                     </p>
                 </a>
             </c:forEach>
         </div>
</div> <!-- /container -->
</body>
</html>
